package model;

import java.lang.reflect.Field;
import java.util.List;
import java.util.Map;

public class PublicFieldDeclared implements StatementKind{
//	private final Class<?> clazz;
	private final Field field;
	public PublicFieldDeclared(Field field){
		this.field= field;
	}
	  public static PublicFieldDeclared getField(Field field) {
		    return new PublicFieldDeclared(field);
		  }

	  public String convertString(){
		  return this.toString1(this.field);
	  }
	  @Override
	  public String toString() {
	    return convertString();
	  }
	  public Field getField() {
		  return this.field;
	  }
	  public Class<?> getOutputType() {
		  return this.field.getType();
	  }
	  
	  public  String toParseableString(Map<String,Class<?>> classesToTest){
		  if(classesToTest.containsKey(this.field.getDeclaringClass().getName()))
			 	return toString1(this.field);		
		 return null;


	  }
	  public List<Class<?>> getInputTypes() {
		  return null;
	  }
	  public  String toString1(Field f) {
		     StringBuilder sb = new StringBuilder();
	//	     sb.append(f.getDeclaringClass().getName().toString()+ " ");		     
	
		     sb.append(f.getType()+" " +f.getName()+" " );
		     	return sb.toString();
		   }
      public  List<Class<?>> getGenericInputRetrnTypes(){
          return null;
  }
}
